package com.augmentum.oes.util;

import java.text.SimpleDateFormat;
import java.util.Date;

public class FormatTimeUtil {

    private final static String PATTERN = "yyyy-MM-dd HH:mm:ss";

    public static String getFormatTime(Date date) {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(PATTERN);
        return simpleDateFormat.format(date);
    }

    public static String getSimpleTime(String date) {
        if (date.length() >= 19) {
            date = date.substring(0, 19);
        }
        return date;
    }

}
